package mosquito.g7.blobs;

import java.util.ArrayList;

public class Blob {

	public void Blob(){
		
	}
	
	public static ArrayList<LineGraph> findBlob(LineGraph in){
		
		for(LineGraph branch : in.getOverlapping()){
			ArrayList<LineGraph> list = findBlob(in, branch);
			if( list != null) {
				list.add(in);
				return list;
			}
		}
		
		return null;
	}
	public static ArrayList<LineGraph> findBlob(LineGraph start,  LineGraph in){

		
		if(in.equals(start)){
			ArrayList<LineGraph> list = new ArrayList<LineGraph>();
			list.add(in);
			return list;
		}
		for(LineGraph branch : in.getOverlapping()){
			ArrayList<LineGraph> list = findBlob(start, branch);
			if( list != null) {
				list.add(in);
				return list;
			}
		}
		
		return null;
	}
}
